package com.igroupes.ovineherd.enums;

public enum ErrorCode implements ResultEnum {

    SYSTEM_ERROR(-1,"系统异常"),
    PARAM_ERROR(10007,"参数错误"),
    ADD_FAIL(10020,"添加数据失败"),
    TYPE_ERROR(10021,"类型有误"),
    SEQUENCE_KEY_NOT_FOUND(20001,"自增字段key不存在"),
    SEQUENCE_EXCEPTION(20002,"自增字段生成失败"),
    FILE_UPLOAD_FAIL(20003,"文件上传失败"),
    FILE_DOWNLOAD_FAIL(20004,"文件下载失败"),
    PERMISSION_DENIED(10050,"权限不足"),
    USER_INFO_ERROR(10051,"用户信息获取失败"),
    ;

    ;
    ErrorCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    private Integer code;
    private String message;

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
